home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / MacApp Documentation / MacApp AppleLink Messages / MacApp.Tech$ Oct 89 / Z0128-Printing in MacApp -Oct89 < prev    next >
Encoding:
Text File  |  1989-10-20  |  2.8 KB  |  68 lines  |  [TEXT/GEOL]

  1. Item forwarded  by  BOWMAN       to TRAMMEL1
  2.  
  3. Item    0148626                         18-Oct-89        12:01
  4.  
  5. From:   A33                             Drexel U, Nadine Perkey, ASC,PRA
  6.  
  7. To:     MACAPP.TECH$                    MACAPP Tech
  8.  
  9. cc:     D2458                           Tactics Int'l, David Shillito,PRT
  10.  
  11. Sub:    Printing in MacApp 2.0B9
  12.  
  13.  
  14. David,
  15.  
  16. I am also working on an application that requires hi res printing. I solved
  17. the problem a while back by overriding TStdPrintHandler (ignoring the tech
  18. notes and the FracApp300 description). The basic idea was to increase the
  19. printer resolution (which will scale the image down) and draw the picture into
  20. a larger rectangle so that the resulting image will be the correct size.
  21.  
  22. In TStdPrintHandler I overrode the following methods:
  23.    SetPrintExtent -
  24.    Expand the sizes of the view and print extent so that our drawing
  25.    gets clipped properly and the printer does not print blank pages.
  26.    PosePrintDialog -
  27.    Scale up the drawing to high res printing JUST before the actual
  28.    printing. We cannot rescale the drawing for printing in the Print
  29.    method because the standard  print handler wants to update the window
  30.    after putting the job dialog away which is before the drawing for the
  31.    actual printing.
  32.    BanishPrintDialog -
  33.    Return the drawing to screen resolution JUST after the actual
  34.    printing.
  35.    Print -
  36.    Call CheckPrinter in case the user has just changed printers via the
  37.    Chooser. If printer IsVariable then SetResolution high. Do inherited
  38.    Print. Restore using SetResolution back to the screen resolution. Also
  39.    restore the size of the view which got adjusted in SetPrintExtent.
  40.  
  41. In TStdPrintHandler I added the following methods:
  42.    IsVariable -
  43.    Return TRUE if the current printer has variable resolution (like the
  44.    LaserWriter and return FALSE if it has discrete resolution (like the
  45.    ImageWriter. If there is something better to check please tell me; I
  46.    did not want to do a check like IF device = LaserWriter THEN do high
  47.    resolution.
  48.    SetResolution -
  49.    Set the current printer and print handler to the highest resolution
  50.    supported by the printer or to the screen resolution.
  51.  
  52. The views that use this print handler need fields representing the horizontal
  53. and vertical scaling factors which get set by the print handler (via an access
  54. method of course) and are used in the coordinate transformation routines. Also,
  55. some access methods were added to the view so we did not have to vandalize the
  56. view's fSize from inside of the print handler.
  57.  
  58. The code for this is (in my opinion) surprisingly clean considering what it has
  59. to do and was not that difficult to write. The hardest part was figuring out
  60. what to override.
  61.  
  62. Hope this helps,
  63.  
  64.    Marianne Cain
  65.    Drexel University
  66.    Software Development Group
  67.  
  68.